package com.tools;

import java.util.Map;
import android.content.Context;
import android.content.SharedPreferences;

public class MySharedPreferences {
	public SharedPreferences	adWhirlPrefs;
	
	public SharedPreferences invoker(Context context) {
		if (adWhirlPrefs == null) {
			adWhirlPrefs = context.getSharedPreferences(context.getPackageName(), Context.MODE_PRIVATE);
		}
		return adWhirlPrefs;
	}
	
	public String getString(String key, String defValue) {
		return adWhirlPrefs.getString(key, defValue);
	}
	
	public long getLong(String key, long defValue) {
		return adWhirlPrefs.getLong(key, defValue);
	}
	
	public boolean getBoolean(String key, boolean defValue) {
		return adWhirlPrefs.getBoolean(key, defValue);
	}
	
	public int getInt(String key, int defValue) {
		return adWhirlPrefs.getInt(key, defValue);
	}
	
	public float getLong(String key, float defValue) {
		return adWhirlPrefs.getFloat(key, defValue);
	}
	
	public Map<String, ?> getLong() {
		return adWhirlPrefs.getAll();
	}
}
